<?php

class SiteSettingsForm extends CFormModel
{
	public $siteName;
	public $systemEmail;

	public function rules()
	{
		return array(
			// name, email, subject and body are required
			array('siteName, systemEmail', 'required'),
			array('siteName, systemEmail', 'safe'),
		);
	}

	public function attributeLabels()
	{
		return array(
			'siteName'=>'Site Name',
			'systemEmail'=>'System Email',
		);
	}
	
	public function insertAdministrator()
	{
		$model = new User();
		$model->setAttribute('active', 1);
		$model->setAttribute('siteName', $this->siteName);
		$model->setAttribute('systemEmail', $this->systemEmail);
		
		$model->save();
	}
}